package com.lzs.adx.web.modules.adx.dao;


import com.lzs.adx.commmon.dao.BaseDao;
import com.lzs.adx.web.modules.adx.dto.ReportResultDTO;
import com.lzs.adx.web.modules.adx.dto.ReportTotalDTO;
import com.lzs.adx.web.modules.adx.entity.ReportEntity;
import com.lzs.adx.web.modules.adx.entity.ReportResultEntity;
import com.lzs.adx.web.modules.adx.entity.ReportTotalEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 广告上报表
 *
 * @author wangzhijun 825400558@qq.com
 * @since 1.0.0 2023-06-06
 */
@Mapper
public interface ReportDao extends BaseDao<ReportEntity> {


    /**
     * 查询包裹详情，
     * @return
     */
    List<ReportResultEntity> selectReportResult();


    /**
     * 查询前一天的数据
     * @return
     */
    List<ReportTotalEntity> selectReportTotal();

    List<ReportTotalEntity> selectReportTotalByDay(@Param("day") String day);


    @Delete({"delete from t_report where day= #{yesterdayStime}"})
    void deleteInfo(String yesterdayStime);


    @Select("select  * from t_report where  dsp_id=#{dspId} and day=#{day} order by create_time desc  limit ${limit}")
    List<ReportEntity> selectListByMap(@Param("dspId") String dspId,@Param("day") String day,@Param("limit") Integer limit);
}